from flask import Blueprint,render_template
from ..database import Article
from ..utils import prettify
from ..secure import login_required

bp = Blueprint('myrecord', __name__, url_prefix="/myrecord")

@bp.route('/')
@bp.route("/<int:page>/")
def myrecord(page=1):

    article_list = Article.query.filter(Article.author.like("%Dragon%")).order_by(Article.publish_time.desc()).paginate(page=page, per_page=10)

    url_for = "myrecord.myrecord"

    return render_template('/pages/myrecord.html', list_all=article_list, url=url_for)
    
